package com.fattyCorps.common.packet.hero.component;

import cn.hutool.extra.spring.SpringUtil;
import com.fattyCorps.common.mgr.Cfg;
import com.fattyCorps.common.obj.config.HeroMould;
import com.fattyCorps.common.packet.hero.Hero;
import lombok.Getter;

public abstract class ABaseHeroComponent implements Component.IComponent {
    @Getter
    protected Hero owner;
    protected HeroMould heroMould;

    @Override
    public void onCreate(Object owner) {
        this.owner = (Hero)owner;
        heroMould = SpringUtil.getBean(Cfg.class).getCfg(HeroMould.class, this.owner.getTypeId());
    }
}
